<!--
 * @Description: 
 * @version: 
 * @Author: 尹鹏孝
 * @Date: 2022-01-21 11:12:36
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2022-01-21 15:52:43
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>求和</title>
</head>

<body>
    <script>
        var sum = function (sum1, sum2, sum3, sum4) {
            var twoMap = new Map();
            let count = 0;
            for (const n1 of sum1) {
                for (const n2 of sum2) {
                    const sum = n1 + n2;
                    twoMap.set(sum, (twoMap.get(sum || 0) + 1))
                }
            }

            for (const n3 of sum3) {
                for (const n4 of sum4) {
                    const sum = n3 + n4;
                    twoMap.set(sum, (twoMap.get(0 - sum) + 1))
                }
            }

            return count;



        }
    </script>
</body>

</html>